package com.ushine.web.base.model.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author: yls
 * @Date: 2021/3/15 14:19
 * @Description: 基础实体类 -- 父类  公共实体类
 * @Version 1.0
 */
@ApiModel(description = "基础字段父类")
@MappedSuperclass
@Data
public class BaseBO implements Serializable {
    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @Column(name = "create_time", columnDefinition = "datetime comment '创建时间'")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人")
    @Column(name = "create_user_name", columnDefinition = "varchar(32) comment '创建人'")
    @TableField(value = "create_user_name", fill = FieldFill.INSERT)
    private String createUserName;

    /**
     * 创建人
     */
    @ApiModelProperty("创建人ID")
    @Column(name = "create_user_id", columnDefinition = "varchar(32) comment '创建人ID'")
    @TableField(value = "create_user_id", fill = FieldFill.INSERT)
    private String createUserId;


    /**
     * 更新时间
     */
    @ApiModelProperty("最近修改时间")
    @Column(name = "last_update_time", columnDefinition = "datetime comment '最近修改时间'")
    @TableField(value = "last_update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastUpdateTime;


    /**
     * 修改人
     */
    @ApiModelProperty("最近修改人")
    @Column(name = "last_update_user", columnDefinition = "varchar(32) comment '最近修改人'")
    @TableField(value = "last_update_user", fill = FieldFill.INSERT_UPDATE)
    private String lastUpdateUser;

}
